<script type="text/javascript" src="<?php echo RESOURCE_PATH;?>/js/jquery.validation.min.js"></script>
<header class="layout head padding-small">
    <a href="javascript:pageBack();" class="hBack float-left"></a>
    <h4 class="hTxt float-left text-center text-white">会员登陆</h4>
    <a href="javascript:;" id="btnJdkey" class="hHlep float-right"></a>
</header>
<!--登陆S-->
<div class="login">
    <form method="post" id="login_form"  class="form-tips">
        <input type="hidden" name="form_submit" value="ok" />
        <input name="nchash" type="hidden" value="<?php echo $output['nchash'];?>" />
        <input type="hidden" value="<?php echo $_GET['ref_url']?>" name="ref_url">
        <div class="userTxt bg-white padding margin-bottom radius-big form-group">
            <div class="clearfix">
                <i class="float-left padding-right border-right border-ef7f7e userName-icon"></i>
                <span class="float-left padding-left field">
                	<input type="text" id="user_name" name="user_name" placeholder="请输入用户名/手机号/邮箱" class="border-none" >
                </span>
            </div>

        </div>

        <div class="userTxt bg-white padding margin-bottom radius-big form-group">
            <div class="clearfix">
                <i class="float-left padding-right border-right border-ef7f7e pwd-icon"></i>
            	<span class="float-left padding-left  field">
                	<input type="password" id="password" name="password" placeholder="请输入密码" class="border-none" >
                </span>
            </div>

        </div>

        <div class="userTxt bg-white padding margin-bottom radius-big clearfix form-group">
            <div class="clearfix">
                <i class="float-left padding-right border-right border-ef7f7e captcha-icon"></i>
                <span class="float-left padding-left  field">
                	<input type="text" id="captcha" name="captcha" placeholder="请输入下面的验证码" class="border-none" maxlength="4">
                </span>
            </div>

        </div>

        <div class="userTxt margin-bottom clearfix">
            <img src="index.php?act=seccode&op=makecode&nchash=<?php echo $output['nchash'];?>" name="codeimage" border="0" id="codeimage"  name="codeimage" id="codeimage" class="border-none float-left ">
            <a href="javascript:void(0)" onclick="javascript:document.getElementById('codeimage').src='index.php?act=seccode&op=makecode&nchash=<?php echo $output['nchash'];?>&t=' + Math.random();" class="float-left padding  margin-left radius-big bg-yellow text-white">看不清，换一张</a>
        </div>

        <div class="userTxt margin-bottom clearfix">
            <input type="checkbox" value="1" name="auto_login" id="auto_login" checked="checked"> <label for="auto_login">10天免登陆</label>
        </div>

        <div class="userTxt margin-bottom ">
            <input type="submit" class="text-white bg-d60079 border-none radius-big padding text-center layout text-big" value="登陆">
        </div>

        <div class="userTxt margin-bottom clearfix">
            <a href="index.php?act=register" class="float-left text-ef7f7e">免费注册</a>
            <a href="index.php?act=login&op=find_password" class="float-right text-ef7f7e">找回密码</a>
        </div>
    </form>
</div>
<!--登陆E-->

<script type="text/javascript">
$(document).ready(function(){
	$("#login_form").validate({
        //放置错误提示的方法
        errorPlacement: function(error, element){
            var error_td = element.parent('span');
           // error_td.find('label').hide();
            error_td.append(error);
        },
		rules: {
			user_name: {
                required	: true,
                minlength 	: 1
            },
			password: {
                required	: true
               // minlength 	:6
               // pwd_v 	: true
            }
			<?php if(C('captcha_status_login') == '1') { ?>
            ,captcha : {
                required : true,
                remote   : {
                    url : 'index.php?act=seccode&op=check&nchash=<?php echo $output['nchash'];?>',
                    type: 'get',
                    data:{
                        captcha : function(){
                            return $('#captcha').val();
                        }
                    }
                }
            }
			<?php } ?>
		},
		messages: {
            user_name: "用户名不能为空",
			password: {
                required:'密码不能为空',
              //  pwd_v:''
            }
			<?php if(C('captcha_status_login') == '1') { ?>
            ,captcha : {
                required : '验证码不能为空',
				remote	 : '验证码输入错误'
            }
			<?php } ?>
		}
	});
});
</script>